home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 1.iso / CYBERVILLAGE / ANT / ANTUTILS.ZIP / !GetmyMail / RunCheck (.txt) < prev   
RISC OS BBC BASIC V Source  |  1998-08-09  |  4KB  |  143 lines

  1.  (V1.71) Runcheck 
  2.  Quantum Software 1997
  3.  FREEWARE
  4.  This program checks to see if the application is loaded
  5.  and if NOT then it runs the application from the full file path supplied.
  6.  use: *Runcheck <full file path>
  7.  See the DATA statements below, if it appears not to work...
  8.  BTW, The best place to put this program is in !Boot.library
  9. ver$="V1.71"
  10. app$="Runcheck"
  11.  buffer% 256,q% 1000
  12.  "OS_GetEnv" 
  13.  command%
  14. !command$=
  15. getstring(command%)
  16.  "OS_GSTrans","<Wimp$State>",buffer%,256
  17. state$=
  18. getstring(buffer%)
  19.  state$="commands" 
  20.  desktop%=
  21.  desktop%=
  22. 4param$=
  23. command$,
  24. (command$)-
  25. command$,""" ")-1)
  26.  "OS_GSTrans",param$,buffer%,256
  27. param$=
  28. getstring(buffer%)
  29. app$=
  30. getleaf(param$,"")
  31. app$,1)="!" 
  32.  app$=
  33. app$,2)
  34. app$=
  35. makelowercase(app$)
  36.  param$="" 
  37.  desktop%=
  38. errorbox(0,"Syntax: '"+app$+" <filepath>. If the application is not loaded it will be run.",2):
  39.  param$="" 
  40.  desktop%=
  41.  app$+" "+ver$+
  42. &0A+"Syntax: Runcheck <full filepath>. If the application is not loaded it will be run.":
  43. initwimp(app$)
  44. param$," ") >0 
  45.  spaces%=
  46.  app$=
  47. app$,
  48. app$," ")-1)
  49.  spaces%=
  50.  PRINT ">>";app$;"<<->>";param$;"<<"
  51.  A%=GET
  52. task%=0
  53. loaded%=
  54.  "TaskManager_EnumerateTasks",task%,buffer%,16 
  55.  task%
  56. 50 task$=
  57. makelowercase(
  58. getstring(buffer%!4))
  59. specialcases(app$) =task$ 
  60.  buffer%!12 = 0 
  61.  loaded%=
  62.  task%=-1
  63.  loaded%=
  64.  spaces%=
  65. "Wimp_StartTask","Filer_Run "+param$
  66.  loaded%=
  67.  spaces%=
  68. "Wimp_StartTask","WIMPTASK "+param$
  69.  loaded%=
  70. ("Set apploaded 1") 
  71. ("Set apploaded 0")
  72.  "Wimp_CloseDown"
  73. getleaf(f$,g$)
  74.  g$="" 
  75.  g$="."
  76. f$,g$)
  77.   f$=
  78. f$,g$)+1)
  79. makelowercase(string$)
  80. H    p$=""
  81.  X%=1 
  82.  string$
  83. string$,X%,1))
  84.  C% <=90 
  85.  C%>=65 
  86.  C%+=32
  87.  p$+=
  88. getstring(ptr%)
  89. Q    p$=""
  90.  (?ptr%>31 
  91.  ?ptr%<256) 
  92. (p$)<255
  93.   c%=?ptr%
  94.   p$+=
  95.   ptr%+=1
  96. specialcases(application$)
  97.  filername$,taskname$
  98.  application$=filername$ 
  99.  filername$="end":application$=taskname$
  100.  filername$="end"
  101. =application$
  102. initwimp(taskname$)
  103.  "Wimp_Initialise",200,&4B534154,taskname$
  104.  finished%=
  105. errorbox(error%,error$,flags%)
  106. g( !buffer%=error%:$(buffer%+4)=error$
  107.  "Wimp_ReportError",buffer%,flags%,app$ 
  108.  ,result%
  109.  result%=2 
  110.  "Wimp_CloseDown":
  111.  "OS_Exit"
  112.  Runcheck relies on the fact that most names in the Task window
  113.  are the same as the Filer name you provided minus the '!'.
  114.  ie ADFS::4.$.!Paint
  115.  But sometimes an application uses a different name in the Task
  116.  window than the limited 10 letter name in the Filer.
  117.  In these cases enter the Filer name followed by the exact name as
  118.  it appears in the task window (please ensure that all letters are
  119.  entered in lowercase.
  120.  email me if you've had to add any.
  121.  stuart@quantumsoft.co.uk
  122.  "fresco"   , "ant fresco"
  123.  "tempdir"  , "tempdirectory"
  124.  "style"    , "impression style"
  125.  "publisher", "impression publisher"
  126.  "publish+" , "publisher plus"
  127.  "pc"       , "pc card software"
  128.  "audiowrks", "audioworks"
  129.  "imagefs"  , "imagefs
  130.  control"
  131.  "appdock2" , "application dock"
  132.  "screensav", "screen saver"
  133.  "quickdir" , "quick directories"
  134.  "omni"     , "omniclient"
  135.  "coolswtch", "coolswitch"
  136.  "trash"    , "trash can"
  137.  "ovnpro"   , "ovationpro"
  138.  "fontdir"  , "font directory"
  139.  "TrceRoute", "traceroute"
  140.  "monty"    , "monty (1.20)"
  141.  leave this line alone and at the end of this file
  142.  "end","end"
  143.